//
//  TDGradientBackground.h
//  iosf
//
//  Created by Ye Yuan on 12-4-3.
//  Copyright (c) 2012年 Neusoft Corporation. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
	TDGradientBackgroundStyleRadial = 0,
	TDGradientBackgroundStyleRadialReversed,
	TDGradientBackgroundStyleLinear,
	TDGradientBackgroundStyleLinearReversed,
	TDGradientBackgroundStyleCenterHighlight,
} TDGradientBackgroundStyle;

typedef enum {
	TDGradientLineModeNone = 0,
	TDGradientLineModeTop = 2,
	TDGradientLineModeBottom = 4,
	TDGradientLineModeTopAndBottom = 8
} TDGradientLineMode;

@interface TDGradientBackground : UIView {
	TDGradientBackgroundStyle	gradientStyle;
	TDGradientLineMode			lineMode;
	CGFloat						*colorComponents;
}

@property (nonatomic, assign) TDGradientBackgroundStyle	gradientStyle;
@property (nonatomic, assign) TDGradientLineMode		lineMode;

- (id)initWithFrame:(CGRect)frame style:(TDGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(TDGradientLineMode)lineModes;
- (id)initWithFrame:(CGRect)frame color:(CGFloat *)components;
- (id)initWithFrame:(CGRect)frame style:(TDGradientBackgroundStyle)aStyle;
- (id)initWithFrame:(CGRect)frame;

- (void)setColorComponents:(CGFloat *)components;

+ (id)gradientWithFrame:(CGRect)frame style:(TDGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(TDGradientLineMode)lineModes;
+ (id)gradientWithFrame:(CGRect)frame color:(CGFloat *)components;
+ (id)gradientWithFrame:(CGRect)frame style:(TDGradientBackgroundStyle)aStyle;
+ (id)gradientWithFrame:(CGRect)frame;
@end
